﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace csharp_ip2host
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("input ip: ");
            string ip_addr = Console.ReadLine();

            IPHostEntry ipHostEntry = Dns.GetHostEntry(ip_addr);
            string host_name = ipHostEntry.HostName;

            Console.WriteLine(host_name);

            Console.Write("Press Anykey...");
            Console.ReadKey();
        }
    }
}
